const webpack = require('webpack')
var pkg = require('./package.json')

const config = {
    devtool: 'cheap-module-eval-source-map',
    entry: __dirname + "/module/index.js",
    output: {
        path: __dirname + "/dist",
        filename: `${pkg.name}.min.js`,
        library: `${pkg.name}`,
        libraryTarget: "umd"
    },
    module: {
        rules: [{
            test: /\.js$/,
            loader: "babel-loader"
        }]
    },
    plugins: [
        new webpack.optimize.UglifyJsPlugin()
    ]
}

module.exports = config
